#include <bits/stdc++.h>
using namespace std;
const int N = 1e6+5;
int n,a[N],mx,f[N];
bool vis[N];
int find(int x)
{
    if(f[x]==x) return x;
    return f[x] = find(f[x]);
}
signed main()
{
    freopen("mcmf.in","r",stdin);
    freopen("mcmf.out","w",stdout);
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n;
    for(int i = 1;i<=n;i++) cin>>a[i]>>a[i],a[i]--;
    sort(a+1,a+n+1);
    for(int i = 1;i<N;i++) f[i] = i;
    for(int i = 1;i<=n;i++)
    {
        int p = find(0);
        vis[p] = 1,f[p] = p+1;
        if(p<a[i])
        {
            if(f[a[i]]==a[i]) vis[a[i]] = 1,f[a[i]] = a[i]+1;
            else
            {
                vis[p] = 0,f[p] = p;
                p = find(a[i]);
                vis[p] = 1,f[p] = p+1;
            }
        }
    }
    bool ok = 0;
    for(int i = N-1;~i;i--)
    {
        if(vis[i]) ok = 1;
        if(ok) cout<<vis[i];
    }
    return 0;
}